﻿using System;
using System.Web.UI.WebControls;

namespace ApplicationGenerator.CommonWeb
{
    /// <summary>
    /// Kontrolka bazowa dla kontrolek umieszczanych na stronie BasePage
    /// </summary>
    public class BaseControl : WebControl
    {
        public void AddErrorMessage(string errorMessage)
        {
            BasePage basePage = this.Page as BasePage;
            if (basePage == null)
            {
                throw new Exception("Strona musi dziedziczyć po BasePage");
            }
            basePage.AddErrorMessage(errorMessage);
        }
    }
}
